#include<stdio.h>

void reverse_str_R(char *str,int len)
{
  char *left = str;
  char *right = str +len-1;
  if(left>=right)
    return;
  char tmp = *left;
  *left = *right;
  *right = tmp;
  reverse_str_R(str+1,len-2);  //注意：此处应该减2；前后都得算进去
}

int main()
{
  char str[] = "abcd1234";
  int len = sizeof(str)/sizeof(char)-1;
  reverse_str_R(str,len);
  printf("%s\n",str);
  return 0;
}
